home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 3
/
ct-rom iiib.zip
/
ct-rom iiib
/
CTSELECT
/
QEDIT
/
QED480.ARC
/
QED.DOC
next >
Wrap
Text File
|
1987-03-16
|
20KB
|
356 lines
QED
This version of Quick Editor was derived from Nigel Gilbert's "E",
as well as code from J. W. Haefner's "QED", and Mel Tearle's "GED".
It is a stripped down, quick, WordStar-like editor. It is essentially a
non-document insert mode editor without formatting commands. It does
extend on WordStar in a few areas however:
o -Jn command line option (or ^J editing option) will jump to
line "n"
o ^QKS switch controls auto-strip of trailing whitespace
o ^QKA switch controls auto-indent for block structured code
o ^QKT variable allows specifying TAB size
o ^QKL switch can shut off status line
o ^QKB switch can shut off backup file generation
o ^_ key will undo deletions so long as you don't leave the line
o -E command line option allows extended chars in text
o -R command line option uses reverse video instead of bright
o ^pg_up capitalizes & ^pg_dn converts to lower case (for a touch
typist who doesn't notice CAPSLOCK till 3 paragraphs later)
The following bugs have been fixed:
o tab portrayal corrected
o Screen is redisplayed on exit from ^QK (context) functions
o Help screen doesn't scroll off
o Recall buffer fixed
o Block menu hangup cured
o All work files closed between consecutive edits
In addition, I've taken the liberty of making the following changes out
of personal taste:
o Exit sequence verbosity reduced and reorganized to more
closely mirror those of WordStar
o ^KD (save & edit another file) and ^KS (save & resume) added
o Display attributes inverted to display text in low intensity
o Normal attribute altered to suit CGA
o Vertical movement through tabspace moves cursor left 1 tabstop
o Word delete from begining of a word deletes up to next word
o Miscellaneous keyboard reassignments (see IBM-PC column below)
Use CTL(^) to enable or disable the help display.
If you have a RAM drive on M: and a Hercules monochrome card, the following
in a BAT file will use M: for the paging file (-dM option), use reverse
video (-r) instead of bright, and enable the help screen (-v) by default:
QED %1 -r -dM -v
I have been adding and adjusting the features of QED as suggestions are
received. To suit those who felt the signon went by too fast to read, a
more distinctive one was added. Since I can't stand signons myself, I
also added a quiet switch (-q option) to bypass it.
COMMAND LINE SWITCH SUMMARY
-A : auto indent -L : line & status display
-B : auto backup -Q : quiet load - no signon
-D : disk for work file -R : reverse video highlight
-E : extended character set -S : strip trailing whitespace
-F : fast load minimal buffer -Tn: tabwidth n columns
-H : horizontal scroll whole page -V : verbose help menu
-Jn: jump to line n -X : overwrite command.com
Howard Vigorita
NYACC, 3/87
DOCUMENTATION FOR QE AND QED
(J. W. Haefner - 7 August 1985)
This is documentation for the programs QE and QED: two modifications of
'e' version 4.6b. QE is the modification for BDS-C and QED is the
modification for DeSmet-C (hence the "D") under MSDOS version 2.x. Since
the basic structure of these modifications is still that of e, that
documentation is relevant and I indicate here only the differences.
'e' is a fine program, carefully written with good logical structure;
however, editors are a personal matter and many features that I thought
desirable were either missing, or awkwardly implemented. Consequently, QE
and QED is the result of an attempt to incorporate different and additional
functions. Most of these derive from WordStar, my favorite word
processor. Since the modifications are basically superficial and (at one
level) "cosmetic", I have retained all references to Nigel Gilbert as the
author and copyright holder. Each file indicates that it is a modification
of the original e (ver. 4.6). On the other hand, my modifications conflict
to some degree with the philosophy detailed in the documentation to the
original 'e'. Therefore, as indication of this possible conflict, I have
given new names to these modifications. The "Q" was originally to mean
"quick", as my initial goal was to produce a smaller, faster version of 'e',
as I thought it terribly long and slow. I did not achieve this goal and
instead came away with the perception that virtural memory editors must be
this large and slow. Mr. Gilbert has done an admirable job.
The documentation is in two parts. Part 1 describes the features
common to both QE and QED. Part two describes the features unique to QED.
I. QE and QED
A. WordStar functions
1. SCROLLING: ^W scrolls the screen down (i.e. UP through the text)
and leaves the cursor on the line and column prior to scroll. ^Z scrolls
the screen up in the same manner.
2. Delete to End of Line: ^QY deletes all text from the cursor to the
end of the line.
3. Delete Line: ^\ now deletes the current line (this makes it
difficult to err, identical to my version of WordStar). In 'e' v 4.6 and QE
and QED lines deleted can be recovered if the cursor has not left its
vertical sceen postion by typing ^N^_ (i.e. insert new empty line (^N), and
recover (^_)). A more elaborate UNDO function is implemented in 'e' ver
4.8, but I don't feel a need for it.
4. Block manipulation: all of these are done through ^K as in
WordStar. These functions are: quit (Q, as in 'e'), save and exit (X, as in
WordStar), file read (R), repeat a jump to the last jump line (J), and the
block moves of 'e' (B).
5. Exit with Save: ^KX saves the file being edited and exits directly
to the operating system.
6. BACKSPACE == LEFTKEY in all applications except find/replace
editing.
7. QUICK functions; analogous to WordStar, ^Q switches to other
functions (i.e. environment (K), delete to end of line (Y), find (F), alter
(A).
8. Top and Bottom o Screen: ^Y moves cursor to top of screen, ^V
moves to bottom of screen.
9. KEYS: wherever possible, I have used WordStar mnemonics for
control characters. This is almost exact for the left hand; the right hand
uses my own choices (e.g. move to left end of line = ^O, to right end of
line = ^P, etc. These are documented with a revised HELP display obtained
via ^^ (difficult to type but the interface is so obvious that I rarely, if
ever, use HELP). Below I give a map of the keys used in QE and QED.
10. READ ALL ON INITIAL LOAD: As a matter of preference, the initial
reading of a file from disk reads the entire file or as much as possible to
fill memory before displaying the first page. Alteration of this feature
currently requires re-compilation, but it could easily be implemented as a
command line option.
B. Fixes to "bugs"
1. DIRECTORY: 'e' ver. 4.6 incorrectly calculated file sizes for my
extended density 8" drives. QE and QED fix this. Moreover, I have added a
directory masking option that permits the use of normal CP/M ambiguous file
characters (*,?) to list a subset fo a directory. In addition, 'e' did not
print a complete directory if longer than one screenful. I have modified
the listing to pause after each page of files.
2. JUMP: Use of "-Jn" on the command line where n is an integer
causes the initial program load to jump to line number n, or the bottom of
the file if n is greater than the number of lines in the file. This is
similar to 'e' ver 4.8. I have further modified the jump command to permit
relative (+/-) jumps of any length (unlike page up or down; alas, not as
useful as I had hoped). Moreover, use of "^J,<CR>" or "^J,ESC" sets the
"jumpto" variable to the current line. Use of ^KJ repeats the last jump.
Thus, a very simple "jump marker" is implemented as the following example
illustrates:
^J,<CR> (mark this line),
...some editing...,
^U (top of file),
... more editing,
^KJ (back to line number marked earlier).
I find this feature very useful. If editing following jump line marking
adds or deletes lines, then ^KJ will not return to the identical text
orginally marked (since that text now has a different line number). This
could be fixed in later versions. More than one "jump marker" would be
desirable.
3. REPEAT PAGING: In repeated use of page up or page down, 'e' ver
4.6 causes all pages to be completely rewritten. To speed up movement
through a file, I allow the rewriting of a page to be interrupted if the
next comand in the buffer is either "pageup" or "pagedown". On the files
QE2A and QE3A for terminals such as ADDS Viewpoint that do not have line
insert functions, scrolling down (^W) requires re-writing the entire page,
this is also enhanced by looking at the type-ahead buffer to interupt page
re-writing if the next character is also for "scroll down".
4. CONTROL CHARACTERS: Use of the sequence "ESC,char" to embed control
characters into the text did not work properly on my 'e' ver. 4.6. This has
been fixed.
5. PRINTING CONTROL CHARACTERS: 'e' transmits only a few (none?)
control characters to the printer. QE and QED send most control characters
so that dot matrix printers can be manipulated within the editor (e.g. set
margins, condensed print, etc).
6. FAST DISPLAY 1: QE and QED use the very nice algorithm in 'e' ver.
4.8 to speed up console display using terminal cursor movement.
7. FAST DISPLAY 2: I allow characters to be inserted into the type-
ahead buffer only after a line has been written except when inserting text.
'e' ver 4.6 checks for more input to buffer after every character is
written. This slows down the display. Checking at the end of each line
seems to cause no problems. Moreover, 'e' ver 4.6 does not check for type-
ahead buffer overflow; this is a problem on fast terminals with repeat keys.
Text insertion is checked after each character inserted so that fast typists
do not lose characters.
8. HIGH-LIGHT CURRENT LINE: The use of all text displayed in normal
attributes or dimmed with current line normal as in verson 4.6 is controlled
by a conditional compile statement. 'e' ver 4.8 uses an internal global
variable permitting switching within sessions. Since I never want that
feature and since the fewer "if-checks" the better, I opted for the re-
compilation solution.
9. FIND/ALTER STRINGS: 'e' ver 4.6 allowed most control characters
to be embedded in the string to find or alter, but escape (0x1b) was used to
terminate the string and thus could not be searched for. I implemented a
kludge to work around this. ^] is translated to 0x1b and embedded in the
string. A reminder of this is presented when the find/alter function is
selected. Also several other control characters can now be embedded that
could not have been in 'e'. Other changes to this function allow the
"retrieve" function to replay the last previous string to find and alter
from the current positon of the cursor in the string to the end. Thus, if
the previous search string is non-empty, then the retrieve function prints
the previous string from the current position to the end. If the previous
search string is empty or the cursor is at the end of the non-empty previous
search string, then use of the retrieve function will embed the key code for
the retrieve function into the search string. For the file of terminal
characteristics currently used, this is ^L, which is also form feed. The
current implementation allows primitive editing of the search string without
re-typing the entire line. Assume the previous search string is non-empty;
the retrieve function (^L) will display to end; backspace and replace
character to be edited; ^L will re-display the remainder of the string. To
re-initialize a search string to be empty, simply backspace to the
beginnning and hit ESC or <cr>.
C. Miscellaneous
1. Files named QEAxx are altered QExx files that have special
routines to speed up an ADDS Viewpoint 3A+ on a slow (4MHz) computer. Mr.
Gilbert warns in the original documentation that terminals without hardwired
"deleteline" functions are not worth installing on 'e'. He is just about
right, these files help a bit.
2. HINTS TO FUTURE MODIFICATIONS: For others that wish to modify
the program for their own purposes, I have these observations. (1) The
files "QEFUNCS.DOC" and "QEDFUNCS.DOC" with this submission lists the
functions in each file used in QE and QED respectively. QEFUNCS.DOC is
relevant to 'e' ver 4.6 also. (2) Debugging messages can be displayed
within the editor by using the statements:
gotoxy(55,0); /* go to the right end of the status line*/
puts(yourmsg); /* yourmsg is a char pointer */
Messages written in this location will not usually be overwritten
immediately. If numeric output is required, the function "uspr" in QE7 can
be used.
II. QED SPECIFIC MODIFICATIONS
QE has been tranlated to DeSmet-C under MSDOS 2.x and called QED.
Because of difference in the compiler and the operating system, several
additional changes have been made.
1. MSDOS Ver 2.0: QED requires generic MSDOS version 2.0 or higher
and checks with a BDOS call that the system uses this version. No IBM-PC etc
specific BIOS calls are used. I.e. no software interrupts below 20 hex are
used, nor are any port or memory specific references made.
2. DIRECTORY: A paging, maskable MSDOS directory can be listed,
as in QE. Path names and sub-directories are supported.
3. NO BDOS ERROR RECOVERY: I don't know how to trap BDOS errors in
MSDOS, therefore Mr. Gilbert's elegant CP/M BDOS traps have been eliminated.
I would, of course, be interested in knowing how to do this.
4. PATHS: Specification of paths is supported for files. A
function to display and alter the path is implemented (via the file context
function: ^QKF). Since full path names can be almost arbitrarily long, the
status line displays only the file name.
5. MODIFICATION CHECK: If the user attempts to discard a modified
file without saving it, a query is presented to ensure this was intentional.
6. DEFAULT EXTENSION: The extension of the file called on the
command line is saved in a default file extension string. Future file
requests (performed within a given QED session) do not require a file
extension to be given. If no extension is given, the directory is first
searched for a file as typed. If this fails, the default extension is
appended to the input file name and the search repeated. The default
extension is overridden by using an explicit extension. The desirable
modification of not having to give the file extenson on the command line is
not necessary in MSDOS by using batch files to invoke QED. For example, if
a series of editing sessions is to be undertaken using assembly language
programming, then the following .BAT file is useful:
QED %1.ASM -T8 -J%2
If this batch file is called, say, "e" then the command line "e myprog 150"
will invoke QED to load MYPROG.ASM, set the tabs to 8 spaces, and jump to
line 150. This could also be done with CP/M, but SUBMIT is slower than
typing in the entire command line.
7. DeSmet SPECIFIC MODIFICATONS: The DeSmet compiler is adequate and
a good buy. Several changes were made from QE (using BDS-C) to accomodate
the different compiler and operating system. (a) The function "uspr" was
altered to take 2 arguments to print either a short or long integer. Long
integers are necessary to display disk space on my 8" disks. (b) The
following functions were renamed to avoid collision with functions loaded by
the DeSmet BINDer: "putc" to "eputc", "getc" to "egetc", "puts" to "eputs".
This renaming might not be necessary, but the manual suggests it is. (c)
the use of "sint" to "char" macro in 'e' was changed to "sint" is "int".
Several variables and intermediate values went negative under MSDOS, causing
problems. So at the expense of data storage, I implemented the easiest
solution I knew.
IV. MAP OF KEYBOARD ASSIGNMENTS
generic IBM-PC
^A WORD LEFT ^left-arrow
^B BOTTOM OF FILE end
^C DOWN PAGE pg-down
^D CHARACTER RIGHT right-arrow
^E UP 1 LINE up-arrow
^F WORD RIGHT ^right-arrow
^G DELETE CHARACTER UNDER CURSOR del
^H NON-DESTRUCTIVE BACKSPACE backspace
^I TAB RIGHT tab
^J JUMP TO LINE n or increment of +/- n
^K BLOCK MANIPULATIONS
B BLOCK MOVES (AS IN 'e')
Q QUIT
W=WRITE FILE
A=ABANDON EDITED FILE
X WRITE FILE AND EXIT TO SYSTEM
J REPEAT JUMP TO LAST MARKED LINE NUMBER
R READ FILE
^L REPEAT LAST FIND/ALTER
^M CARRIAGE RETURN enter
^N NEW LINE
^O MOVE TO LEFTMOST CHARACTER ON LINE ^home
^P MOVE TO RIGHTMOST CHARACTER ON LINE ^end
^Q 'QUICK' OPTIONS
A FIND AND REPLACE
F FIND
K EDITING CONTEXT (TABS, FILES, ETC.)
Y DELETE TO END OF LINE
^R UP 1 SCREEN pg-up
^S CHARACTER LEFT left-arrow
^T DELETE WORD TO THE RIGHT
^U MOVE TO TOP OF FILE home
^V MOVE TO BOTTOM OF SCREEN
^W SCROLL UP THROUGH TEXT (CURSOR CONSTANT)
^X LINE DOWN down-arrow
^Y MOVE TO TOP OF SCREEN
^Z SCROLL DOWN THROUGH TEXT (CURSOR CONSTANT)
^[ ESCAPE esc
^\ DELETE LINE
^] NO FUNCTION
^^ HELP
^_ RESTORE EDITED/DELETED LINE
DEL DELETE CHARACTER TO LEFT OF CURSOR ^backspace
V. FUTURE MODIFICATIONS
My future projects with QED are the following. In further violation
of Nigel Gilbert's philosopy, I will create another editor based on QED that
has wordwrap, variable right margins and simple reformatting capabilites so
that QED plus a runoff program (NRO, ROFF, etc) will look more like a word
processor. Second, I would like to add to this latter editor outline
processing capabilities along the lines of "Thinktank". Third, I want to
add regular expression capabilities to the find/alter function of QED so as
to implement a better version of the UNIX editor "vi." This should not
be terribly difficult with the appropriate subroutines used from a public
domain "grep" or from the vanNuys Toolkit (e.g. "sub"). Finally, (and
actually more immediately) I am porting QED to the VAX 780. It will be
disappointing at 1200 baud, but better than the line editor currently
available.